
//
//  UIImage+Lc.h
//  18Birdies
//
//  Created by Lc on 15/4/3.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (Lc)

// 1x1 image with specified color
+ (UIImage*)imageWithColor:(UIColor*)color;
+ (UIImage*)imageWithColor:(UIColor*)color andSize:(CGSize)size;
+ (UIImage*)circleImageWithColor:(UIColor*)color andRadius:(CGFloat)radius;
+ (UIImage*)linearImageWithStartColor:(UIColor*)startColor
                             endColor:(UIColor*)endColor
                              andSize:(CGSize)size;
// image.size = view.size * scale, scale > 0
// out put image will be 1x
+ (UIImage*)imageFromUIView:(UIView*)view scale:(CGFloat)scale;

+ (UIImage*)imageFromUIView:(UIView*)view targetRect:(CGRect)targetRect;

+ (UIImage*)snapShotFromUIView:(UIView*)view targetRect:(CGRect)targetRect;

// 1x1 image of fully transparent
+ (UIImage*)transparentImage;

- (UIImage*)scaleToSize:(CGSize)size;
- (UIImage*)scaleWithRatio:(CGFloat)ratio;
- (UIImage*)cropImageWithRect:(CGRect)rect;
- (UIImage*)clearImageWithRect:(CGRect)rect;

- (UIImage*)imageRotatedByRadians:(CGFloat)radians;

+ (UIImage*)normalizedImageByOrientationCorrectForImage:(UIImage*)image;
- (UIImage*)maskWithColor:(UIColor*)color;

+ (UIImage*)imageOfResizingModeTileWithName:(NSString*)imageName;

- (CGSize)scaleToFillLimitSize:(CGSize)limitSize;

@end
